//document.onkeydown = function() {
//	if (event.keyCode == 8 && (event.srcElement.type != "text" && event.srcElement.type != "textarea" 
//		&& event.srcElement.type != "password" && event.srcElement.type != "select"))
//		return false;
//};
// document.onkeydown=null;
// For IE
if (typeof window.event != 'undefined') {
	document.onkeydown = function() {
		var type = event.srcElement.type;
		var code = event.keyCode;
		return ((code != 8 && code != 13) || 
			(type == 'text' && code != 13) || 
			(type == 'textarea') || type == 'password' ||
			(type == 'submit' && code == 13))
	}
} else { // FireFox/Others
	document.onkeypress = function(e) {
		var type = e.target.type;
		var code = e.keyCode;
		if ((code != 8 && code != 13) || 
			(type == 'text' && code != 13) || 
			(type == 'textarea') ||  type == 'password' ||
			(type == 'submit' && code == 13)) {
			return true
		} else {
			return false
		}
	}
} 
